<div class="row">
<div class="span12">      		
	   		
	<div class="widget ">
		<div class="widget-header">
			<i class="icon-plus"></i>
 			<h3>添加分组</h3>
		</div> <!-- /widget-header -->

		<div class="widget-content">
		
		<div class="alert alert-danger hide" role="alert"></div>

		<form id="add-task" action="{{urlfor "GroupController.Add"}}" method="post" class="form-horizontal">
			<fieldset>
				
				<div class="control-group">											
					<label class="control-label" for="group_name">组名</label>
					<div class="controls">
						<input type="text" name="group_name" class="span6" id="group_name">
					</div>				
				</div>
				
				<div class="control-group">											
					<label class="control-label" for="description">说明</label>
					<div class="controls">
						<textarea name="description" class="span6" id="description" rows="6"></textarea>
					</div> <!-- /controls -->				
				</div> <!-- /control-group -->
		
				<br />
				
					
				<div class="form-actions">
					<button type="submit" class="btn btn-primary">保 存</button> 
					<a href="{{urlfor "GroupController.List"}}" class="btn">返 回</a>
				</div> <!-- /form-actions -->
			</fieldset>
		</form>

		</div>
	</div>
</div>
</div>

<script>
$(function () {
	$("form").submit(function () {
		$(".alert").hide();
		$("button[type='submit']").attr('disabled', true);
		$.post('{{urlfor "GroupController.Add"}}', $(this).serialize(), function (out) {
			if (out.status == 0) {
				window.location.href = '{{urlfor "GroupController.List"}}';
			} else {
				$(".alert").text(out.msg);
				$(".alert").show();
				$("button[type='submit']").attr('disabled', false);
			}
		}, "json");
		return false;
	});
});
</script>